/*
 * @Descripttion:
 * @version:
 * @Author: captern@icloud.com
 * @Date: 2023-05-08 15:00:05
 * @LastEditors: captern
 * @LastEditTime: 2023-05-08 15:19:14
 */
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/Home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: HomeView,
      children: [
        { path: '', name: 'home', component: HomeView, meta: { title: '欢迎' } }
        // {
        //   path: 'template/:id',
        //   name: 'template',
        //   component: () => import('../views/TemplateDetail.vue'),
        //   meta: { title: '模版详情' }
        // }
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('@/views/AboutView.vue')
    },
    {
      path: '/editor/:id',
      name: 'editor',
      component: () => import(/* webpackChunkName: "editor" */ '../views/Editor.vue'),
      meta: { requiredLogin: true, title: '编辑我的设计' }
    }
  ]
})

export default router
